﻿@using System.Web.UI.WebControls
@model Blog.Models.PostModel

@{
    ViewBag.Title = Model.Title;
}

<div class="col-sm-8">
    <div style=" font-family:Arial">
        <div class="row">
            

    <h3>@Model.Title</h3>
    @*<p>@Model.PostId</p>*@
    <p>@Model.CreationDate</p>
    <h4>@Model.Content</h4>
    
    @if(Model.FeaturedImage!=null)
    { 
        <img src="/Content/images/@Model.FeaturedImage" />
    }
    
    <br/>
    <h3>Kommentarer:</h3>

            <br />
            <h3>Kommentarer:</h3>

            @foreach (var comment in Model.Comments)
            {
                <br />
                <p>@comment.CreationDate</p>
                <h4>@comment.CommentText</h4>
                <h5>@comment.Name</h5>
            }

        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="well well-sm">
                    @using (Html.BeginForm("CreateComment", "Post"))
                    {
                        @Html.AntiForgeryToken();
                        @Html.ValidationSummary();
                        <fieldset>
                            <legend class="text-center">Skriv en kommentar</legend>

                            <!-- Name input-->
                            <div class="form-group">
                                <label class="col-md-3 control-label" for="name">Namn</label>
                                <div class="col-md-9">
                                    @Html.TextBoxFor(p => p.Comment.Name, new { @class = "form-control" })
                                    @Html.ValidationMessage("Name")
                                </div>
                            </div>

                            <!-- Email input-->
                            <div class="form-group">
                                <label class="col-md-3 control-label" for="email">E-post</label>
                                <div class="col-md-9">
                                    @Html.TextBoxFor(p => p.Comment.Email, new { @class = "form-control" })
                                    @Html.ValidationMessage("Email")
                                </div>
                            </div>

                            <!-- Message body -->
                            <div class="form-group">
                                <label class="col-md-3 control-label" for="message">Kommentar</label>
                                <div class="col-md-9">
                                    @Html.TextBoxFor(p => p.Comment.CommentText, new
                                    {
                                        @class = "form-control",
                                        rows = 5
                                    })
                                    @Html.ValidationMessage("CommenText")
                                </div>
                            </div>

                            <!-- Form actions -->
                            <div class="form-group">
                                <div class="col-md-12 text-right">
                                    @Html.HiddenFor(p => p.PostId)
                                    <input type="submit" value="Spara" class="btn btn-primary btn-lg" />
                                </div>
                            </div>
                        </fieldset>
                    }
                </div>
            </div>
        </div>
    </div>
    <div class="col-sm-4 blog-sidebar">
        <div class="sidebar-module sidebar-module-inset">
            <div style=" font-family:Arial">
                <h3> @Html.ActionLink("Tillbaka till bloggaren", "FullDetails", "User", routeValues: new { id = @Model.UserId }, htmlAttributes: null)</h3>

            </div>
        </div>
    </div>

            </div>

            @section scripts
{
                @Scripts.Render("~/bundles/jqueryval")
            }










@*@*<div class="col-sm-4 blog-sidebar">
    <div class="sidebar-module sidebar-module-inset">
        <div style=" font-family:Arial">

            <h4>Blogg</h4>
            @*@*@*@Html.Partial("_ListAllBlogs", Model.Blogs)*@*@*@
                @*<br />
                <h4>Av</h4>
                <h2>@Model.Users.Name</h2>
                <br />
                <h4>Bloggar om</h4>
                <h3>@Model.Users.BlogsAbout</h3>
                <br />
                <h4>Presentation</h4>
                <h3>@Model.Users.Presentation</h3>


                <br />*@
            @*<h4>Intressanta länkar</h4>

                @Html.Partial("_BlogRollOnUserId", Model.BlogRolls)*@
           @*<br />
                            <br />

                            <h4> @Html.ActionLink("Tillbaka till lista med bloggare", "Index", "Blog", new { userId = @Model.Users.UserId }, null)</h4>

                        </div>

                    </div>
                </div>*@



